import request from '@/api/quantui.js'

function login(data) {
  return request({
    // url: 'http://192.168.101.4/kpi/mobile/system/login.do',
    url: 'http://house.ksljz.cn:8081/house/mobile/system/login.do',
    // url: 'http://192.168.101.4/house/mobile/system/login.do',
    // url: 'http://192.168.101.4/house/house/houseBase/jgListNg.do',
    method: 'get',
    data
  })
}

function logout(data) {
  return request({
    url: 'http://house.ksljz.cn:8081/house/mobile/system/logout.do',
    method: 'get',
    data
  })
}

function getHouseList(data) {
  return request({
    url: 'http://house.ksljz.cn:8081/house/house/houseBase/jgListNg.do',
    method: 'get',
    data
  })
}

function getHouseMore(data) {
  return request({
    url: 'http://house.ksljz.cn:8081/house/house/houseBase/getNg.do',
    method: 'get',
    data
  })
}

function saveInspect(data) {
  return request({
    url: 'http://house.ksljz.cn:8081/house/house/housePatrol/saveForm.do',
    method: 'post',
    data,
  })
}

// 无效
function uploadImage(data, headers) {     // 未使用
  // console.log('api.js', data, headers)
  return request({
    url: 'http://house.ksljz.cn:8081/house/platform/system/sysFile/fileUpload.do',
    method: 'post',
    data,
    headers
  })
}

function getZ(data) {
  return request({
    url: '/fdcloud-boot/map/mapResource/list',
    // http://47.114.102.94:9090/fdcloud-boot/map/mapResource/list?ztlx=%E5%95%86%E5%8A%A1%E6%A5%BC%E5%AE%87&pageSize=100&ztmc=**
    // url: 'http://house.ksljz.cn:8081/house/mobile/system/login.do',
    method: 'get',
    data
  })
}

// 房管显示地址的
function getInfor(id) {
  return request({
    url: 'http://house.ksljz.cn:8081/house/house/houseBase/listNg.do?id=' + id,
    method: 'get',
  })
}

export default {
  login,
  logout,
  getHouseList,
  getHouseMore,
  saveInspect,
  uploadImage,   // 未使用
  getZ,
  getInfor
}